﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Select.aspx.cs" Inherits="WebApplication1.Select" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  
    <asp:DropDownList runat="server" ID="listOfConnectionTypes" >
       <asp:ListItem Text="friends" />
       <asp:ListItem Text="home" />
       <asp:ListItem Text="feed" />
       <asp:ListItem Text="likes" />
       <asp:ListItem Text="movies" />
       <asp:ListItem Text="music" />
       <asp:ListItem Text="books" />
       <asp:ListItem Text="notes" />
       <asp:ListItem Text="permissions" />
       <asp:ListItem Text="photos" />
       <asp:ListItem Text="albums" />
       <asp:ListItem Text="videos" />
       <asp:ListItem Text="events" />
       <asp:ListItem Text="groups" />
       <asp:ListItem Text="checkins" />
    </asp:DropDownList>

    <asp:Button Text="Select" runat="server" ID="btnSelectConnectionType" />
    

    OnKeyPress Search On List : <input type="text" id="texttoSearch" /> 
    <hr />
    <div id="searchResults">
    
    
    <asp:ListView runat="server" ID="listResults" >
        <LayoutTemplate>
        <div id="itemPlaceholder" runat="server">
            <asp:PlaceHolder ID="itemContainer" runat="server" />
        </div>
    </LayoutTemplate>
    <ItemSeparatorTemplate>
         <p></p>
      </ItemSeparatorTemplate>
    <ItemTemplate>
        <ul>
            <li> Id:  <%# ((Dictionary<string, object>)Container.DataItem)["id"].ToString()%> </li>
            <li>Name: <%# ((Dictionary<string, object>)Container.DataItem)["name"].ToString()%> </li>
            <li> Created Time :<%# ((Dictionary<string, object>)Container.DataItem)["created_time"].ToString()%> </li>
         </ul>   
    </ItemTemplate>
    </asp:ListView>
    </div>

    <script type="text/javascript">

        $().ready(function () {

            $("#texttoSearch").bind("keyup", function (e) {


                $.each($("#searchResults ul"), function (index, item) {

                    if ($(item).text().match($("#texttoSearch").val()) == null)
                        $(item).hide();
                    else
                        $(item).show();
                });

            });
        });
    </script>

</asp:Content>
